home *** CD-ROM | disk | FTP | other *** search
- //
- // MiscDocument.h -- document controller
- // Written by Mike Ferris Copyright (c) 1993, 1995 by Mike Ferris.
- // Modified for use in the MiscKit by Don Yacktman from MODocController.
- // Version 1.0. All rights reserved.
- // This notice may not be removed from this source code.
- //
- // This object is included in the MiscKit by permission from the author
- // and its use is governed by the MiscKit license, found in the file
- // "LICENSE.rtf" in the MiscKit distribution. Please refer to that file
- // for a list of all applicable permissions and restrictions.
- //
-
- // ABOUT MiscDocument
- //
- // MiscDocument is a subclass of MiscNibController which adds file
- // support. Each MiscDocument has a window (inherited from
- // MiscNibController) and a file to save the window in. Documents can
- // be untitled (no file yet). Documents need not have windows. Documents
- // can be managed by a MiscDocManager.
- //
- // By itself, a subclass of MiscDocument can keep track of whether
- // it is untitled or has a file. It can perform all the standard file
- // operations new, open, save, revert, save as, and save to, if several
- // methods are provided in the subclass. It will also alert the user
- // if it is dirty and they try to close it allowing them to save and
- // close, close without saving or cancel the close.
- //
- // With a MiscDocManager subclass it will uniquely number untitled
- // documents and stagger windows. As well as other things documented
- // in the MiscDocManager class header.
-
- #import <misckit/MiscNibController.h>
-
- // Forward declarations of class names we'll use for static typing.
- @class MiscString;
- @class MiscDocManager;
- @class MiscDocType;
-
- @interface MiscDocument:MiscNibController
- {
- MiscDocManager *manager;
- MiscString *docName;
- MiscString *untitledString;
- MiscDocType *docType;
- BOOL isDirty;
-
- // save panel popup accessory outlets
- id saveAccessoryPanel;
- id saveAccessoryBox;
- id saveAccessoryPopupButton;
- }
-
- + initialize;
-
- + setControllerName:(const char *)typeName;
- + (MiscString *)controllerName;
-
- + addDocType:(int)tag name:(const char *)name extension:(const char *)ext
- openSelector:(SEL)openSel saveSelector:(SEL)saveSel;
- + (List *)docTypes;
- + (MiscDocType *)docTypeForTag:(int)tag;
- + (MiscDocType *)docTypeForName:(const char *)name;
- + (MiscDocType *)docTypeForExtension:(const char *)extension;
- + (List *)getOpenTypesList:(List *)list;
- + (List *)getSaveTypesList:(List *)list;
-
- + startUnloading;
-
- - initFromFile:(const char *)path manager:aManager;
- - initWithFrameName:(const char *)theFrameName;
- - initWithFrameName:(const char *)theFrameName
- fromFile:(const char *)path manager:aManager;
- - free;
-
- - nibDidLoad;
-
- - (BOOL)doClear;
- - (BOOL)doPrint;
-
- - saveAccessoryPopupAction:sender;
- - getSaveAccessoryForSaveTypes:(List *)saveTypes
- currentType:(MiscDocType *)currentType;
-
- - save:sender;
- - saveAs:sender;
- - saveTo:sender;
- - revert:sender;
- - close:sender;
- - print:sender;
-
- - saveIfNeeded;
-
- - setManager:aManager;
- - manager;
- - setFile:(const char *)fName;
- - (BOOL)isUntitled;
- - (const char *)file;
- - docName;
-
- - resetWindowTitle;
- - setDirty:(BOOL)flag;
- - (BOOL)isDirty;
-
- - windowDidBecomeMain:sender;
- - windowDidResignMain:sender;
- - windowWillClose:sender;
-
- - awake;
- - read:(NXTypedStream *)strm;
- - write:(NXTypedStream *)strm;
-
- @end
-
-